package fr.afcepf.ai85.gepeto.managedBean;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import com.sun.org.apache.bcel.internal.generic.NEW;

import fr.afcepf.ai85.ent.TypeActivite;
import fr.afcepf.ai85.gepeto.service.ServiceActivite;

@ManagedBean(name = "beanActivite")
@SessionScoped
public class BeanActivite {

	int idActivite;
	String nomActivite;
	String matin;
	String cantine;
	String soir;
	Integer idMatin;
	Integer idCantine;
	Integer idSoir;
	
	List<TypeActivite> listeActivites;
	
	
	
public String listeDesActivites(){
		
		listeActivites = ServiceActivite.listeActivites();
		idMatin = listeActivites.get(0).getIdActivite();
		idCantine = listeActivites.get(1).getIdActivite();
		idSoir = listeActivites.get(2).getIdActivite();
		matin = listeActivites.get(0).getNomActivite();
		cantine = listeActivites.get(1).getNomActivite();
		soir = listeActivites.get(2).getNomActivite();
		
				return "";
	}

	public BeanActivite() {
		listeDesActivites();
	}
	
	
	
	public Integer getIdCantine() {
		return idCantine;
	}

	public void setIdCantine(Integer idCantine) {
		this.idCantine = idCantine;
	}

	public Integer getIdSoir() {
		return idSoir;
	}

	public void setIdSoir(Integer idSoir) {
		this.idSoir = idSoir;
	}

	public Integer getIdMatin() {
		return idMatin;
	}

	public void setIdMatin(Integer idMatin) {
		this.idMatin = idMatin;
	}

	public String getMatin() {
		return matin;
	}

	public void setMatin(String matin) {
		this.matin = matin;
	}

	public String getCantine() {
		return cantine;
	}

	public void setCantine(String cantine) {
		this.cantine = cantine;
	}

	public String getSoir() {
		return soir;
	}

	public void setSoir(String soir) {
		this.soir = soir;
	}

	public int getIdActivite() {
		return idActivite;
	}

	public void setIdActivite(int idActivite) {
		this.idActivite = idActivite;
	}

	public String getNomActivite() {
		return nomActivite;
	}

	public void setNomActivite(String nomActivite) {
		this.nomActivite = nomActivite;
	}

	public List<TypeActivite> getListeActivites() {
		return listeActivites;
	}

	public void setListeActivites(List<TypeActivite> listeActivites) {
		this.listeActivites = listeActivites;
	}
	
	
	
}
